package xml;
import java.util.Vector;



public class Team {

	private int id;
	private String name;
	private Vector<Player> players;
	private int goals;
	private int halfTimeGoals;
	
	public Team(int id){
		this.id = id;
		this.name="";
		this.goals = 0;
		this.halfTimeGoals = 0;
		this.players = new Vector<Player>();
	}

	public String getName(){
		return this.name;
	}
	public void setName(String name){
		this.name=name;
	}
	public Player getPlayer(int id){
		for (Player p : players)
		{
			if (p.getID() == id)
			{
				return p;
			}
		}
		return null;
	}
	
	public void addPlayer(int id){
		players.add(new Player(id));
	}

	public int getGoals() {
		return goals;
	}

	public int getHalfTimeGoals() {
		return halfTimeGoals;
	}

	public void addHalftimeGoals(int g) {
		this.halfTimeGoals+=g;
	}

	public void addGoals(int g) {
		this.goals+=g;
	}
	
	public Vector<Player> getPlayers() {
		return players;
	}

}
